//
//  MAHomeWatchCell.m
//  meiang_edu
//
//  Created by hfcb on 2018/8/1.
//  Copyright © 2018年 com.meiang.meiang_edu. All rights reserved.
//

#import "MAHomeWatchCell.h"
#import "MAJiGouModel.h"
#import "MAFuncItemModel.h"

@interface MAHomeWatchCell ()
@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (weak, nonatomic) IBOutlet UIImageView *vipIcon;


@end

@implementation MAHomeWatchCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.autoresizingMask = UIViewAutoresizingNone;
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] lastObject];
    }
    return self;
}

- (void)setModel:(MAJiGouModel *)model {
    _model = model;
    [self.iconView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",IMG_OSS,model.ps_id]] placeholderImage:[UIImage imageNamed:@"homepage_navigationbar_picture"]];
    self.iconView.layer.cornerRadius = 15;
    self.iconView.layer.masksToBounds = YES;
    self.nameLabel.text = model.cname;
}

- (void)setFuncItemModel:(MAFuncItemModel *)funcItemModel {
    _funcItemModel = funcItemModel;
    
    [self.iconView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",IMG_OSS,funcItemModel.image]]];
    self.nameLabel.text = funcItemModel.function_name;
    self.vipIcon.hidden = YES;
}
@end
